#ifndef AVALON_SOCKETEXCEPTION_HPP
#define AVALON_SOCKETEXCEPTION_HPP
#include "Avalon/IO/IOException.hpp"
#include "Avalon/Network/Network.hpp"

namespace Avalon {
namespace Network {

  /*! \class SocketException
   *  \brief Indicates that an operation on a socket failed.
   *  \author Kamal Mansouri <kranar@hotmail.com>
   */
  class SocketException : public IO::IOException {
    public:

      //! Constructs a SocketException.
      /*!
        \param The error code, typically provided by the underlying system.
        \param The error message.
      */
      SocketException(int code, const std::string& message);

      virtual ~SocketException() throw();

      //! Returns the error code.
      int GetCode() const;

    private:
      int m_code;
  };
}
}

#endif // AVALON_SOCKETEXCEPTION_HPP
